#ifndef _GEO_LINEMANAGER_H_
#define _GEO_LINEMANAGER_H_

#include "GeometryBase.h"

class CVertexManager;
class CSurfaceManager;
class CSketchModel;


class CLineManager
{
	friend class CVertexManager;
	friend class CSurfaceManager;
	friend class CSketchModel;
public:
	CLineManager(CVertexManager* pVManager);
	~CLineManager();

	bool AddLineSegment(CLineSegment l);
	bool AddScaffold(CScaffold s);
	bool DeleteLineSegment(CLineSegment l);
	bool DeleteScaffold(CScaffold s);

	void AddLineFromHead(CLineSegment l);
	bool DeleteLineFromHead();

	int GetLineSegmentCount();
	int GetScaffoldCount();

	CLineSegment GetLineSegment(int index);
	CScaffold GetScaffold(int index);

	CLineSegment GetNearestLineSegment(CVertex v, CVector2D dir);
	CScaffold GetNearestScaffold(CVertex v, CVector2D dir);


protected:
private:
	list<CLineSegment> m_lSegment;
	list<CScaffold> m_lScaffold;

	CVertexManager* m_pVManager;
};

typedef list<CLineSegment>::iterator CLineSegmentIter;
typedef list<CScaffold>::iterator CScaffoldIter;

#endif